home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-09-27 | 3.9 KB | 178 lines | [TEXT/CWIE] |
- // COPYRIGHT 1994 A.D. Software, All rights reserved
-
- // OOFILE c-tree Plus backend implementation
-
- // IMPLEMENTATION inline definitions
-
-
- // -------------------------------------------------------
- // O O F _ t a b l e B a c k e n d _ c t r e e
- // -------------------------------------------------------
- inline void OOF_tableBackend_ctree::ResetCtreeFileNoForStartOfConnection(COUNT nextFileNo)
- {
- OOF_tableBackend_ctree::sNextFileNo = nextFileNo;
- }
-
-
- inline void OOF_tableBackend_ctree::EnsureOurContextMatchesISAM()
- // this routine is necessary as we may have a clone of this selection
- // that's changed the current ISAM record
- // it's also not a bad sanity check on ourself if we've moved records
- // NOT YET IMPLEMENTED an optimisation that might be applied would
- // be to only perform this test if this backend has been cloned
- {
- if (mCurrLoadedRecOffset != CurrentFileOffset(mISAMdatno))
- SetISAMtoContext(this);
- }
-
-
-
- // -------------------------------------------------------
- // O O F _ C o n t e x t _ c t r e e
- // -------------------------------------------------------
- inline void OOF_Context_ctree::SetOffset(LONG off)
- {
- mCurrLoadedRecOffset = off;
- }
-
-
- inline VRLEN OOF_tableBackend_ctree::BlobLenFromBuffer(const dbField* fld, const char* theirBuffer) const
- {
- return BlobLenFromBuffer(fld->fieldNumber(), theirBuffer);
- }
-
-
- inline LONG OOF_tableBackend_ctree::BlobPosFromBuffer(const dbField* fld, const char* theirBuffer) const
- {
- return BlobPosFromBuffer(fld->fieldNumber(), theirBuffer);
- }
-
-
-
- // -------------------------------------------------------
- // O O F _ c t r e e S e l e c t i o n R e p
- // -------------------------------------------------------
-
- inline unsigned long* OOF_ctreeSelectionRep::ExposeArray()
- {
- return mBits;
- }
-
-
- inline void OOF_ctreeSelectionRep::MarkAsUsed(unsigned long numUsedAtFront)
- {
- mNextFreeEntry = numUsedAtFront;
- }
-
-
- // -------------------------------------------------------
- // O O F _ c t r e e S e l e c t i o n
- // -------------------------------------------------------
-
- inline unsigned long OOF_ctreeSelection::count() const
- {
- if (!mRep)
- return 0;
- return mRep->count();
- }
-
-
- inline void OOF_ctreeSelection::start()
- {
- mInternalIter = 0;
- }
-
-
- inline bool OOF_ctreeSelection::more() const
- {
- return mInternalIter < count();
- }
-
-
- inline void OOF_ctreeSelection::next()
- {
- mInternalIter++;
- }
-
-
- inline OOF_ctreeSelection::selectionState OOF_ctreeSelection::state() const
- {
- return mState;
- }
-
-
- inline bool OOF_ctreeSelection::isEmpty() const
- {
- return mState==empty;
- }
-
-
- inline LONG OOF_ctreeSelection::oneRecOffset() const
- {
- return mCurrSingleRecOffset;
- }
-
-
- inline unsigned long& OOF_ctreeSelection::operator()() // current value
- {
- assert(mRep);
- return mRep->operator[](mInternalIter);
- }
-
-
- inline unsigned long& OOF_ctreeSelection::currentItem()
- {
- assert(mRep);
- return mRep->operator[](mInternalIter);
- }
-
-
- inline unsigned long& OOF_ctreeSelection::operator[](long index)
- {
- assert(index>=0);
- assert(mRep);
- return mRep->operator[] ((unsigned int) index);
- }
-
-
- inline unsigned long& OOF_ctreeSelection::operator[](unsigned long index)
- {
- assert(mRep);
- return mRep->operator[](index);
- }
-
-
- inline unsigned long OOF_ctreeSelection::value(unsigned long index) const
- {
- assert(mRep);
- return mRep->value(index);
- }
-
-
- // -------------------------------------------------------
- // O O F _ c t r e e I n d e x D e s c r i p t i o n
- // -------------------------------------------------------
- inline fieldNumT OOF_ctreeIndexSegList::fieldNo(unsigned short segmentNo) const
- {
- assert(segmentNo<sizeof(mSegmentFieldNos)/sizeof(unsigned short));
- return mSegmentFieldNos[segmentNo];
- }
-
-
- inline COUNT OOF_ctreeIndexSegList::indexFileNo() const
- {
- return mIndexFileNo;
- }
-
-
- inline const dbCompoundField* OOF_ctreeIndexSegList::indexField() const
- {
- return mIndexField;
- }
-
-
- inline bool OOF_ctreeIndexSegList::startsWith(unsigned short fieldNo) const
- {
- return (mSegmentFieldNos[0]==fieldNo);
- }
-